<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="author" content="lijun; 67086071; zwlijun@qq.com" />
<title>XLib.PageBar</title>
<link href="css/api.css" rel="stylesheet" type="text/css" />
</head>

<body>
  <table>
    <caption>Constructor Summary</caption>
    <tr>
      <th>PageBar</th>
      <td>XLib.PageBar(String id)</td>
      <td class="desc">构建一个新的PageBar实例。</td>
    </tr>
  </table>
  <table>
    <caption>Property Summary</caption>
    <tr>
      <th>String</th>
      <td>TPL_PARAM.FIRST</td>
      <td class="desc">${first}<br />第一页模板数据，做为标签属性<br />如：&lt;a ${first}&gt;第一页&lt;/a&gt;</td>
    </tr>
    <tr>
      <th>String</th>
      <td>TPL_PARAM.PRE</td>
      <td class="desc">${pre}<br />上一页模板数据，做为标签属性<br />如：&lt;a ${pre}&gt;上一页&lt;/a&gt;</td>
    </tr>
    <tr>
      <th>String</th>
      <td>TPL_PARAM.PAGES</td>
      <td class="desc">${pages}<br />页码模板数据<br />如：&lt;a ${handler}&gt;${page}&lt;/a&gt;</td>
    </tr>
    <tr>
      <th>String</th>
      <td>TPL_PARAM.PAGE</td>
      <td class="desc">${page}<br />页码值<br />${page}:: 1</td>
    </tr>
    <tr>
      <th>String</th>
      <td>TPL_PARAM.NEXT</td>
      <td class="desc">${next}<br />下一页模板数据，做为标签属性<br />如：&lt;a ${next}&gt;下一页&lt;/a&gt;</td>
    </tr>
    <tr>
      <th>String</th>
      <td>TPL_PARAM.LAST</td>
      <td class="desc">${last}<br />最后页模板数据，做为标签属性<br />如：&lt;a ${last}&gt;最后页&lt;/a&gt;</td>
    </tr>
    <tr>
      <th>String</th>
      <td>TPL_PARAM.ALL</td>
      <td class="desc">${all}<br />所有页码<br />${all}:: 1/100</td>
    </tr>
    <tr>
      <th>String</th>
      <td>TPL_PARAM.HANDLER</td>
      <td class="desc">${handler}<br />翻页处理函数模板，做为标签属性<br />${handler}</td>
    </tr>
    <tr>
      <th>String</th>
      <td>TPL_PARAM.FIRSTSHIFT</td>
      <td class="desc">${firstShift}<br />首页偏移显示<br />${firstShift}</td>
    </tr>
    <tr>
      <th>String</th>
      <td>TPL_PARAM.LASTSHIFT</td>
      <td class="desc">${lastShift}<br />末页偏移显示<br />${lastShift}</td>
    </tr>
    <tr>
      <th>int</th>
      <td>pageInfo.recordcount</td>
      <td class="desc">总记录数</td>
    </tr>
    <tr>
      <th>int</th>
      <td>pageInfo.pagecount</td>
      <td class="desc">总页数</td>
    </tr>
    <tr>
      <th>Array</th>
      <td>pageInfo.positions</td>
      <td class="desc">页栏显示位置ID集</td>
    </tr>
    <tr>
      <th>int</th>
      <td>pageInfo.pageSize</td>
      <td class="desc">每页显示记录数</td>
    </tr>
    <tr>
      <th>int</th>
      <td>pageInfo.radius</td>
      <td class="desc">半径</td>
    </tr>
    <tr>
      <th>int</th>
      <td>pageInfo.page</td>
      <td class="desc">初始页码</td>
    </tr>
    <tr>
      <th>String</th>
      <td>pageInfo.currentClass</td>
      <td class="desc">当前页样式</td>
    </tr>
    <tr>
      <th>Object</th>
      <td>pageInfo.tpl</td>
      <td class="desc">模板数据<br />String bar 页栏模板<br />String pages 页码模板<br />String dot 省略号，如：&lt;a ${handler}如：&gt;${page}&lt;/a&gt;</td>
    </tr>
    <tr>
      <th>Function</th>
      <td>pageInfo.handler</td>
      <td class="desc">点击页码处理函数</td>
    </tr>
    <tr>
      <th>Array</th>
      <td>pageInfo.args</td>
      <td class="desc">参数</td>
    </tr>
    <tr>
      <th>int</th>
      <td>currentPage</td>
      <td class="desc">当前页码,0开始</td>
    </tr>
    <tr>
      <th>int</th>
      <td>totalPage</td>
      <td class="desc">总页码</td>
    </tr>
    <tr>
      <th>Boolean</th>
      <td>isInit</td>
      <td class="desc">是否已经初始化</td>
    </tr>
  </table>
  <table>
    <caption>Method Summary</caption>
    <tr>
      <th>void</th>
      <td><a href="#init">init(Object pageInfo)</a></td>
      <td class="desc">初始化</td>
    </tr>
  </table>
  <hr />
  <pre>
    <h4>void init()<a name="init"></a></h4>
    初始化
    参数：pageInfo - 页码信息
    返回：
    示例：
var pageBar = new XLib.PageBar();    
pageBar.init({
    recordcount:count,
    pageSize:6,
    shift:0,
    showPages:8,
    page:page,
    positions:['page_bar'],
    handler:this.jumpPage,
    args:[tab],
    currentClass:"current",
    tpl : {
        bar : '&lt;span class="page_list"&gt;&lt;button class="present" type="button" ${pre}&gt;上一页&lt;/button&gt;${pages}&lt;button class="present" type="button" ${next}&gt;下一页&lt;/button&gt;&lt;/span&gt; ',
        pages : '&lt;a href="###" ${handler}&gt;${page}&lt;/a&gt;',
        dot : '&lt;button type="button" class="ellipsis"&gt;...&lt;/button&gt;'
    }
});    
  </pre>
</body>
</html>
